public class Action {
    public final Actions type;
    public final int[] move;
    public final long time;
    public final int toMove;
    public final boolean blackToMove;

    public Action(Actions type) {
        this(type, null, 0, 0, true);

        if (type != Actions.QUIT) {
            throw new IllegalArgumentException();
        }
    }

    public Action(int[] move, long time) {
        this(Actions.MOVE, move, time, 0, true);
    }

    public Action(int toMove, boolean blackToMove) {
        this(Actions.BACK, null, 0, toMove, blackToMove);
    }

    private Action(Actions type, int[] move, long time,
                   int toMove, boolean blackToMove)
    {
        this.type = type;
        this.move = move;
        this.time = time;
        this.toMove = toMove;
        this.blackToMove = blackToMove;
    }
}
